package com.mytijian.openapi.adapter.dianping.service;

import java.util.List;

import com.mytijian.openapi.adapter.dianping.model.AsyncRequest;
import com.mytijian.openapi.adapter.dianping.param.AsyncRequestQuery;

/**
 * 异步请求信息保存服务
 * @author clozz
 *
 */
public interface AsyncRequestService {
	
	/**
	 * 保存异步请求信息
	 * @param request
	 * @return
	 */
	boolean saveRequest(AsyncRequest request);
	
	/**
	 * 查询异步请求信息
	 * @param query
	 * @return
	 */
	List<AsyncRequest> listRequests(AsyncRequestQuery query);
	
	/**<pre>
	 * 更新异步请求信息
	 * 允许跟新的字段有：
	 * 	requestStatus
	 * 	requestTryCount
	 * 	asyncNotifyStatus
	 * 	asyncNotifyTryCount
	 * @return
	 */
	boolean updateRequest(AsyncRequest request);
}
